import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../controller/index.dart';
import '../widgets/initial_widget.dart';


class ReportsView extends StatelessWidget {
  const ReportsView({Key? key}) : super(key: key);

  Widget _builBody(BuildContext context) {
    return BlocBuilder<ReportsCubit, ReportsState>(
        builder: (context, state) {
          return state.when(
            initial: () => const InitialWidget(),
            error: (failure) => const InitialWidget(),);
        });
  }

  @override
  Widget build(BuildContext context) {
    return BlocProvider(
      create: (_) => ReportsCubit(),
      child: _builBody(context),
    );
  }
}
